using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class usercontrols_ucSearchMon : System.Web.UI.UserControl
{
    FastFoodBO foodBO = new FastFoodBO();
     protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {           
            DataTable tbResult = getDataTableResult();
            show(tbResult);
        }

    }
    private DataTable getDataTableResult()
    {
        DataTable sanPhamBO = new DataTable("FastFood");
        sanPhamBO = foodBO.GetSearchMonOnTop();
        return sanPhamBO;
    }
    protected void show(DataTable tableResult)
    {
        if (!IsPostBack)
        {
            dataListSP.DataSource = getDataTableResult();
            dataListSP.DataBind();
        }
        else
        {
            dataListSP.DataSource = getDataTableResult();
            dataListSP.DataBind();
        }
    }
}
